<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../vue.js"></script>
  </head>
  <body>
    <!-- ref (操作dom结构)
        例：<div ref="box"></div>
        this.$refs.box 来进行使用 -->
    <div id="app">
      <p>姓名: <input ref="ipt" type="text" /></p>
      <p>年龄: <input type="text" /></p>
      <audio controls src=""></audio>
    </div>
    <script>
      new Vue({
        el: "#app",
        created() {},
        /* 操作dom */
        mounted() {
          this.$refs.ipt.focus();
        },
      });
    </script>
  </body>
</html>
